home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / 3DGPL 1.0 / CODE / HARDWARE / 386-WAT / HARDWARE.H < prev   
Encoding:
C/C++ Source or Header  |  1995-06-20  |  3.0 KB  |  92 lines  |  [TEXT/MACA]

  1. #ifndef _HARDWARE_H_
  2. #define _HARDWARE_H_
  3.  
  4. /** 3DGPL *************************************************\
  5.  *  (MSDOS, i386+, VGA, WATCOM C)                         * 
  6.  *  Header for hardware specific stuff.                   *
  7.  *                                                        *
  8.  *  hardware.c               hardware specific stuff.     *
  9.  *                                                        *
  10.  *  (6/1995) By Sergei Savhenko. (savs@cs.mcgill.ca).     *
  11.  *  Copyright (c) 1995 Sergei Savchenko.                  *
  12.  *  THIS SOURCE CODE CAN'T BE USED FOR COMERCIAL PURPOSES *
  13.  *  WITHOUT AUTHORISATION                                 *
  14. \**********************************************************/
  15.  
  16. typedef short signed_16_bit;                /* compiler/mashine dependent */
  17. typedef int   signed_32_bit;                
  18. typedef unsigned short unsigned_16_bit;       
  19. typedef unsigned int   unsigned_32_bit;
  20.  
  21. void HW_set_int(int *dst,int lng,int val);  /* fast memory operations */
  22. #pragma aux HW_set_int=   \
  23.  "cld"                    \
  24.  "rep stosd"              \
  25.  parm [edi] [ecx] [eax];
  26.  
  27. void HW_set_char(char *dst,int lng,char val);
  28. #pragma aux HW_set_char=  \
  29.  "cld"                    \
  30.  "rep stosb"              \
  31.  parm [edi] [ecx] [al];
  32.  
  33. void HW_copy_int(int *src,int *dst,int lng);
  34. #pragma aux HW_copy_int=  \
  35.  "cld"                    \
  36.  "rep movsd"              \
  37.  parm [esi] [edi] [ecx];
  38.  
  39. void HW_copy_char(char *src,char *dst,int lng);
  40. #pragma aux HW_copy_char= \
  41.  "cld"                    \
  42.  "rep movsb"              \
  43.  parm [esi] [edi] [ecx];
  44.  
  45. #define HW_SCREEN_X_SIZE         320             
  46. #define HW_SCREEN_Y_SIZE         200        /* number of pixels total */
  47.  
  48. #define HW_SCREEN_X_MAX          319
  49. #define HW_SCREEN_Y_MAX          199        /* number of maximum pixel */
  50.  
  51. #define HW_SCREEN_X_CENTRE       160 
  52. #define HW_SCREEN_Y_CENTRE       100        /* middle of the screen */
  53.  
  54. #define HW_COLOURMAP_SIZE_CHAR 64000        /* bytes in the colourmap */
  55. #define HW_COLOURMAP_SIZE_INT  16000        /* ints in the colourmap */
  56.  
  57. struct HW_colour                            /* describes colour */
  58. {
  59.  int hw_r;
  60.  int hw_g;
  61.  int hw_b;                                  /* intensity components */
  62. };
  63.  
  64. int HW_open_screen(char *display_name,
  65.                    char *screen_name, 
  66.                    struct HW_colour palette[256],
  67.                    unsigned char *colourmap
  68.                   );
  69. void HW_blit(void);
  70. void HW_close_screen(void);
  71.  
  72. #define HW_KEY_ARROW_LEFT  75
  73. #define HW_KEY_ARROW_RIGHT 77
  74. #define HW_KEY_ARROW_UP    72
  75. #define HW_KEY_ARROW_DOWN  80
  76.  
  77. #define HW_KEY_PLUS        43
  78. #define HW_KEY_MINUS       45
  79.  
  80. #define HW_KEY_ENTER       13
  81. #define HW_KEY_SPACE       32
  82. #define HW_KEY_TAB          9               /* all i can think of */ 
  83.  
  84. void HW_run_event_loop(void (*application_main)(void),
  85.                        void (*application_key_handler)(int key_code)
  86.                       );
  87. void HW_quit_event_loop(void);
  88.  
  89. /**********************************************************/
  90.  
  91. #endif
  92.